#ifndef ROLENETSERVER_H
#define ROLENETSERVER_H

#include <QObject>
#include <QTcpServer>
#include <QDebug>
#include <QList>
#include "connectionthread.h"

class RoleNetServer : public QTcpServer
{
    Q_OBJECT
public:
    explicit RoleNetServer(QObject *parent = 0);
    void StartServer();
    void WriteToAll(QByteArray data); // Write to every connected socket
signals:
    void writing(QByteArray data); // left 4 future
public slots:
    void receiveData(QByteArray data); // on data received from any sock.
private:
    void incomingConnection(int handle); // handles incoming connections
    QList<ConnectionThread *> *thrlist; // list of active thread
};

#endif // ROLENETSERVER_H
